package cn.iocoder.yudao.module.fm.dal.mysql.fileinfourl;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.fm.dal.dataobject.fileinfourl.FileInfoUrlDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.fm.controller.admin.fileinfourl.vo.*;

/**
 * 文件信息 Mapper
 *
 * @author 档案
 */
@Mapper
public interface FileInfoUrlMapper extends BaseMapperX<FileInfoUrlDO> {

    default PageResult<FileInfoUrlDO> selectPage(FileInfoUrlPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<FileInfoUrlDO>()
                .eqIfPresent(FileInfoUrlDO::getUrl, reqVO.getUrl())
                .eqIfPresent(FileInfoUrlDO::getParentId, reqVO.getParentId())
                .betweenIfPresent(FileInfoUrlDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(FileInfoUrlDO::getId));
    }

    default List<FileInfoUrlDO> selectList(FileInfoUrlExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<FileInfoUrlDO>()
                .eqIfPresent(FileInfoUrlDO::getUrl, reqVO.getUrl())
                .eqIfPresent(FileInfoUrlDO::getParentId, reqVO.getParentId())
                .betweenIfPresent(FileInfoUrlDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(FileInfoUrlDO::getId));
    }

}
